package com.atguigu.tingshu.common.zipkin;

import lombok.extern.slf4j.Slf4j;
import org.springframework.core.task.TaskDecorator;

/**
 * @author 饭勺
 * @description zipkin装饰器
 * @createDate 2025/10/14 16:46
 */
@Slf4j
public class ZipkinTaskDecorator implements TaskDecorator {

    private ZipkinHelper zipkinHelper;

    public ZipkinTaskDecorator(ZipkinHelper zipkinHelper) {
        this.zipkinHelper = zipkinHelper;
    }

    @Override
    public Runnable decorate(Runnable runnable) {
        return zipkinHelper.wrap(runnable);
    }
}
